<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen">
</head>
<body>
    <div class="entry"> 
 <p>账户信息相关函数</p> 
 <ul> 
  <li><a href="#AccountBalance"><strong>AccountBalance()</strong></a> – 获取账户余额 </li> 
  <li><a href="#AccountCredit"><strong>AccountCredit()</strong></a> – 获取账户信用额度 </li> 
  <li><a href="#AccountCompany"><strong>AccountCompany()</strong></a> – 获取账户所在公司名称 </li> 
  <li><a href="#AccountCurrency"><strong>AccountCurrency()</strong></a> – 获取账户结算货币名称 </li> 
  <li><a href="#AccountEquity"><strong>AccountEquity()</strong></a> – 获取账户净值 </li> 
  <li><a href="#AccountFreeMargin"><strong>AccountFreeMargin()</strong></a> – 获取账户可用保证金 </li> 
  <li><a href="#AccountFreeMarginCheck"><strong>AccountFreeMarginCheck()</strong></a> – 检查账户可用保证金 </li> 
  <li><a href="#AccountFreeMarginMode"><strong>AccountFreeMarginMode()</strong></a> – 可用保证金计算方式 </li> 
  <li><a href="#AccountLeverage"><strong>AccountLeverage()</strong></a> – 获取账户杠杆比例 </li> 
  <li><a href="#AccountMargin"><strong>AccountMargin()</strong></a> – 获取账户已用保证金 </li> 
  <li><a href="#AccountName"><strong>AccountName()</strong></a> – 获取账户名 </li> 
  <li><a href="#AccountNumber"><strong>AccountNumber()</strong></a> – 获取账户号码 </li> 
  <li><a href="#AccountProfit"><strong>AccountProfit()</strong></a> – 获取账户盈利金额 </li> 
  <li><a href="#AccountServer"><strong>AccountServer()</strong></a> – 获取账户连接的服务器名称 </li> 
  <li><a href="#AccountStopoutLevel"><strong>AccountStopoutLevel()</strong></a> – 获取账户的止损水平设置 </li> 
  <li><a href="#AccountStopoutMode"><strong>AccountStopoutMode()</strong></a> – 获取账户止损计算方式 </li> 
 </ul> 
 <p>&nbsp;</p> 
 <h2><a name="AccountBalance"></a>AccountBalance() – 获取账户余额</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountBalance()</pre> 
 <p>返回账户余额(账户中钱数) . </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户余额 = ",AccountBalance());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountCredit"></a>AccountCredit() – 获取账户信用额度</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountCredit()</pre> 
 <p>返回账户信用额度. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户信用额度 = ", AccountCredit());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountCompany"></a>AccountCompany() – 获取账户所在公司名称</h2> 
 <pre class="brush: mql4; toolbar: false;">string AccountCompany()</pre> 
 <p>返回账户所在公司名称. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户所在公司名:", AccountCompany());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountCurrency"></a>AccountCurrency() – 获取账户结算货币名称</h2> 
 <pre class="brush: mql4; toolbar: false;">string AccountCurrency()</pre> 
 <p>返回账户结算货币名称. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户结算货币:", AccountCurrency());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountEquity"></a>AccountEquity() – 获取账户净值</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountEquity()</pre> 
 <p>返回账户净值. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户净值 = ", AccountEquity());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountFreeMargin"></a>AccountFreeMargin() – 获取账户可用保证金</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountFreeMargin()</pre> 
 <p>返回账户可用保证金. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户可用保证金 = ", AccountFreeMargin());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountFreeMarginCheck"></a>AccountFreeMarginCheck() – 检查账户可用保证金</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountFreeMarginCheck( string symbol, int cmd, double volume)</pre> 
 <p>当前账户以现价在指定的位置开仓后还剩余的保证金。如果保证金余额不足，将会生成<a href="377.html#Error_codes">错误134</a> (ERR_NOT_ENOUGH_MONEY)。</p> 
 <p>参数:</p> 
 <pre>symbol - 交易的货币对。
cmd - 交易类型，可能是 <a href="374.html#Trade_operations">OP_BUY</a> 或者 <a href="374.html#Trade_operations">OP_SELL</a>。
volume - 交易手数。</pre> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">if(AccountFreeMarginCheck(Symbol(),OP_BUY,Lots)&lt;=0 || GetLastError()==134)
  return;</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountFreeMarginMode"></a>AccountFreeMarginMode() – 可用保证金计算方式</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountFreeMarginMode()</pre> 
 <p>开仓时可用保证金计算方式。计算方式可能采取以下值:</p> 
 <ul> 
  <li>0一浮动盈利/亏损不参与计算 </li> 
  <li>1一浮动盈利和亏损在开仓部头寸上参与保证金余额计算; </li> 
  <li>2一只有赢利参与计算，不考虑当前开仓头寸的亏损; </li> 
  <li>3一只有亏损额参与计算，不考虑当前开仓头寸的亏损。 </li> 
 </ul> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">if(AccountFreeMarginMode()==0)
   Print("浮动盈利/亏损不使用。");</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountLeverage"></a>AccountLeverage() – 获取账户杠杆比例</h2> 
 <pre class="brush: mql4; toolbar: false;">int AccountLeverage()</pre> 
 <p>返回账户杠杆比例. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户杠杆比例:", AccountLeverage());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountMargin"></a>AccountMargin() – 获取账户已用保证金</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountMargin()</pre> 
 <p>返回账户已用保证金金额. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户已用保证金:", AccountMargin());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountName"></a>AccountName() – 获取账户名</h2> 
 <pre class="brush: mql4; toolbar: false;">string AccountName()</pre> 
 <p>返回账户的账户名. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户名:", AccountName());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountNumber"></a>AccountNumber() – 获取账户号码</h2> 
 <pre class="brush: mql4; toolbar: false;">int AccountNumber()</pre> 
 <p>返回账户的账户号码. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户号码:", AccountNumber());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountProfit"></a>AccountProfit() – 获取账户盈利金额</h2> 
 <pre class="brush: mql4; toolbar: false;">double AccountProfit()</pre> 
 <p>返回账户的盈利金额. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户盈利:", AccountProfit());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountServer"></a>AccountServer() – 获取账户连接的服务器名称</h2> 
 <pre class="brush: mql4; toolbar: false;">string AccountServer()</pre> 
 <p>返回账户连接的服务器名称. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("服务器名称:", AccountServer());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountStopoutLevel"></a>AccountStopoutLevel() – 获取账户的止损水平设置</h2> 
 <pre class="brush: mql4; toolbar: false;">int AccountStopoutLevel()</pre> 
 <p>返回账户止损水平设置. </p> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">Print("账户止损水平设置 = ", AccountStopoutLevel());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 
 <h2><a name="AccountStopoutMode"></a>AccountStopoutMode() – 获取账户止损计算方式</h2> 
 <pre class="brush: mql4; toolbar: false;">int AccountStopoutMode()</pre> 
 <p>返回账户止损水平的计算方式，计算方式可以采用下列的值：</p> 
 <ul> 
  <li>0一计算保证金和净值之间的百分比； </li> 
  <li>1一比较剩余保证金标准和绝对值。 </li> 
 </ul> 
 <p>示例:</p> 
 <pre class="brush: mql4; toolbar: false;">int level=AccountStopoutLevel();
if(AccountStopoutMode()==0)
   Print("止损水平= ",level, "%");
else
   Print("止损水平= ", level, " ", AccountCurrency());</pre> 
 <div class="divider top-of-page">
  <a title="Top of Page" href="#top">Back to Top</a>
 </div> 本文地址：
 <a href="382.html" rel="bookmark"><b>382.html</b></a> 
</div>
</body>
</html>